#include<func.h>
#include<mysql/mysql.h>

int main()
{
    MYSQL* mysql=mysql_init(NULL);
    if(mysql==NULL)
    {
        printf("%s\n",mysql_error(mysql));
    }

    if(!mysql_real_connect(mysql,"localhost","root","123456","homework",0,NULL,0))
       {
       printf("%s\n",mysql_error(mysql));
       }

       int ret=mysql_query(mysql,"insert into s  (name,gender,age,major,department,no)\
                           values(\"王倪\",\"m\",25,\"计算机科学\",\"计算机科学\",201813)");
       if(ret==0)
       printf("执行成功\n");
       else
       printf("执行失败\n");
       mysql_close(mysql);

       }
